#ifdef COMPILE_OPENGL
#include "COGL_AtomicFactory.h"

#include "COGL_PixelBufferAtomic.h"
#include "COGL_ShaderProgramAtomic.h"
#include "COGL_IndexBufferAtomic.h"
#include "COGL_VertexBufferAtomic.h"

CB_SUBNAMESPACE_START(OpenGL)

CAtomicFactory::CAtomicFactory(SNativeHandle& _rHandle)
{
}

// -------------------------------------------------------------------------------

CAtomicFactory::~CAtomicFactory()
{
}

// -------------------------------------------------------------------------------

RenderLib::CBufferAtomicPtr CAtomicFactory::CreateIndexBuffer(RenderLib::CIndexBufferDescriptor& _rDescriptor)
{
	CIndexBufferAtomic* pNewAtomic = new CIndexBufferAtomic(_rDescriptor);
    return RenderLib::CBufferAtomicPtr(pNewAtomic);
}

// -------------------------------------------------------------------------------

RenderLib::CBufferAtomicPtr CAtomicFactory::CreateVertexBuffer(RenderLib::CVertexBufferDescriptor& _rDescriptor)
{
	CVertexBufferAtomic* pNewAtomic = new CVertexBufferAtomic(_rDescriptor);
    return RenderLib::CBufferAtomicPtr(pNewAtomic);
}

// -------------------------------------------------------------------------------

RenderLib::CBufferAtomicPtr CAtomicFactory::CreatePixelBuffer(RenderLib::CPixelBufferDescriptor& _rDescriptor)
{
	CPixelBufferAtomic* pNewAtomic = new CPixelBufferAtomic(_rDescriptor);
    return RenderLib::CBufferAtomicPtr(pNewAtomic);
}

// -------------------------------------------------------------------------------

RenderLib::CShaderProgramAtomicPtr CAtomicFactory::CreateShaderProgram()
{
    CShaderProgramAtomic* pNewAtomic = new CShaderProgramAtomic();
	return RenderLib::CShaderProgramAtomicPtr(pNewAtomic);
}

// -------------------------------------------------------------------------------

RenderLib::CShaderProgramAtomicPtr CAtomicFactory::CreateShaderProgram(RenderLib::CShaderProgramDescriptor& _rDescriptor)
{
	CShaderProgramAtomic* pNewAtomic = new CShaderProgramAtomic();
    pNewAtomic->SetSourceAndCompile(_rDescriptor);
    
	return RenderLib::CShaderProgramAtomicPtr(pNewAtomic);
}

CB_SUBNAMESPACE_END
#endif